<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    <div class="box">
        <i>hello world</i>
    </div>
    <input type="text" id="username" value="123123" />
</body>
<script>

    var box = document.querySelector(".box")
    var un = document.querySelector("#username")

    // 获取
    console.log(box.innerHTML);
    console.log(box.innerText);
    console.log(box.value);
    
    console.log(un.innerHTML);
    console.log(un.innerText);
    console.log(un.value);

    // 设置
    box.innerHTML = "hahahahah";
    box.innerText = "heiheiheieh";
    un.value = "abcdef"

    // 区别：
    box.innerHTML = "<b>文字</b>";
    box.innerText = "<b>文字</b>";

</script>
</html>